﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using LogisticsBLL;
using Model;

namespace WebLosgic.TruckTeam
{
    public partial class TruckInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int id = Convert.ToInt32(Request.QueryString["tid"]);
                if (id != 0)
                {
                    BindTruck(id);
                }
                else
                {
                    Response.Redirect("CLxinxi.aspx");
                }
            }
            
        }

        public void BindTruck(int id)
        {
           
            TruckBLL tub = new TruckBLL();
            Model.Trucks mt = tub.BIndturck(id);
            LabNumber.Text = mt.Number;
            int  stae= mt.State;
            if (stae == 1)
            {
                labState.Text = "承运中";
            }
            else
            {
                labState.Text = "空闲中";
            }
            LabTeamName.Text = mt.TeamName;
            LabLength.Text = mt.Length;
            LabTonnger.Text = mt.Tonnage;
            labBuydate.Text = mt.BuyDate.ToString();
            TxtRemark.Text = mt.Remark;
            LabType.Text = mt.Type;
        }

        protected void BtnReturn_Click(object sender, EventArgs e)
        {
            Response.Redirect("CLxinxi.aspx");
        }
    }
}